package ru.kisa_wst.Tests;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import ru.kisa_wst.HTTP.HTTPHeader;

public class HTTPHeaderTest {
	public static void main(String[] args) throws IOException{
		URL url =new URL("http://www.google.com");
		URLConnection url_conn = url.openConnection();
		HTTPHeader header = new HTTPHeader((HttpURLConnection)url_conn);
		System.out.println("Redirect to "+header.getURLIfRedirect());
		System.out.println("Server is "+header.getServerName());
		System.out.println("Encoding is "+header.getHTMLCharsetEncoding());
		System.out.println("Cookie "+header.getCookieIfSetCookie());
		System.out.println("Is text content "+header.isTextContent());
		System.out.println("Warning: "+header.getWarning());
		System.out.println("Is not found "+header.isNotFound());
	}
}
